let stack;
let currentToken = null;
let currentAttribute = null;
let currentTextNode = null;

function emit(token) {

}


const EOF = Symbol("EOF");


function data(c){

}


function tagOpen(c) {

}


function tagName(c) {


}


function beforeAttributeName(c) {

}


function attributeName(c) {

}

function beforeAttributeValue(c) {

}


function doubleQuotedAttributeValue(c) {

}

function singleQuotedAttributeValue(c) {

}

function afterQuotedAttributeValue(c) {

}

function selfClosingStartTag(c) {

}

function afterAttributeName(c) {

}

export function parseHTML(html) {
    stack = [{type: "document", children:[]}];
    currentToken = null;
    currentAttribute = null;
    currentTextNode = null;

    let state = data;
    for(let c of html) {
        state = state(c);
    }
    state = state(EOF);
    return stack[0];
}











